void vdAddImamFunctions(void);

typedef struct {
	 char TPK[32];
	char MK[32];
	char Mpass[6];
	char Ppass[6];
	}DBSF;
#define DBS_SIZE_FILE  sizeof (DBSF)
#define DBSFILENAME		"DBSdat"
#define DBS_TPK   "DBS.TPK"
#define DBS_MK   "DBS.MK"
#define DBS_MPASS   "DBS.MP"
#define DBS_PPASS   "DBS.PP"

#define DBS_SETNET_IP_LOCAL	1
#define DBS_SETNET_SUB_LOCAL	2
#define DBS_SETNET_GW_LOCAL	3
#define DBS_SETTID_SET			4
#define DBS_SETMID_SET			5
#define DBS_SET_DATE			6	
#define DBS_SETNET_IP_HOST		7	
#define DBS_SETSET_NET_PORT_HOST	8
#define DBS_SET_ALL			9


 int inCalculatePin(unsigned char *szPAN, char * PINInput,unsigned char *ePIN);
int inSettingLocalIp(TRANSACTION_OBJECT *pobTran);
int inSettingLocalSub(TRANSACTION_OBJECT *pobTran);
int inSettingLocalGW(TRANSACTION_OBJECT *pobTran);
int inSettingLocalTID(TRANSACTION_OBJECT *pobTran);
int inSettingLocalMID(TRANSACTION_OBJECT *pobTran);
int inSettingLocalDate(TRANSACTION_OBJECT *pobTran);
int inSettingLocalHostIP(TRANSACTION_OBJECT *pobTran);
int inSettingLocalHostPort(TRANSACTION_OBJECT *pobTran);

int inSettingAll(TRANSACTION_OBJECT *pobTran);
int CreateDBSRecord(void);
int inImamSetDisplayType (void);
int inImamInit (TRANSACTION_OBJECT *pobTran);
int inImamInitHostConfig(TRANSACTION_OBJECT *pobTran);
int inImamInitOthers(TRANSACTION_OBJECT *pobTran);
int inGet3DESPin(unsigned char *szPAN, unsigned char *ePIN);//
#ifdef __arm

extern short EESL_get_number_of_tasks(short * numberTasks);
#endif
#ifdef  _TARG_68000
extern short EESL_get_number_of_tasks(int * numberTasks);

#endif

int inImamInitUclComm (TRANSACTION_OBJECT *pobTran);
int inImamInitUclCommEx(void);
int inImamReleaseComm(void);
int inImamExit(TRANSACTION_OBJECT *pobTran);
int inImamExitByCancel(TRANSACTION_OBJECT *pobTran);
int inImamIdleLoop (TRANSACTION_OBJECT *pobTran);
int inImamBatchCorrection(TRANSACTION_OBJECT *pobTran);
extern int inCPACGetMerchEnable(TRANSACTION_OBJECT* pobTran);
extern void vdSetTCFlag (BATCH_REC *psrBRec, unsigned char * pszData);
extern void vdCustCalculateCoord(int inType,int* inCol,int* inRow);
int inImamTxRx8583 (int inModem, int inMode, unsigned char *pstReqBuf, unsigned int inReqSiz, unsigned char *pstRespBuf,
	unsigned int inRespSiz, unsigned int inRespTimout, unsigned int inCarrierTimout);
int inImamCheckDuplicate(unsigned char *szBuff, int inLen);
int inImamDisplaySignalStrength (TRANSACTION_OBJECT *pobTran);

int inImamWirelessConnect (TRANSACTION_OBJECT *pobTran);
int inImamSelectComm (TRANSACTION_OBJECT *pobTran);
int inImamSetMasterKey (TRANSACTION_OBJECT *pobTran);
int inImamLoadGetCDTIndex (TRANSACTION_OBJECT *pobTran, char *pchPan);

int inImamCardTrxCheck(TRANSACTION_OBJECT *pobTran);
int inImamGetInstallments(TRANSACTION_OBJECT *pobTran);
int inImamGetTicketId(TRANSACTION_OBJECT *pobTran);
int inCPACValidateTicketID (char *szString);
int inImamSetParmDownConfig(TRANSACTION_OBJECT *pobTran);
int inImamSetFullDownConfig(TRANSACTION_OBJECT *pobTran);
int inImamCustScroll(TRANSACTION_OBJECT *pobTran);


int inImamPrintISOPacket(VS_BOOL fSendPacket, unsigned char *pucMessage, int inLen);

int inImamCustGetPartialPointAmount(TRANSACTION_OBJECT *pobTran);
int inImamCustGetTip (TRANSACTION_OBJECT *pobTran);
int inImamCustGetBaseAmount(TRANSACTION_OBJECT *pobTran);
int inImamCustGetAmount(char *szAmount, long lnMin, long lnMax,char *pszDisplaySymbol, long lnMsgId);
int inImamEnterNumber(WIN_INFO * psr_wi8x21Win, char *szResponseString, int inMaxChars, char *szCurSym, char *szAmtFormat);
void vdImamEntryDisplayAt ( WIN_INFO * wi8x21Win, int inCol, int inRow, char * szDispBuf, int inClear );
int inImamWaitKey(int inSeconds);

int inImamRecvCModePacket(int inHandle, char *pchRecBuf, int inMaxRecSize, VS_BOOL fStripStxEtx, 
                      int inRespTimeOut, VS_BOOL fSendAck, int inMaxRetries);

void vdImamCheckIdleTimeOut(void);
int inBGMenuChoice(char *Label, char *MenuItem1, char *MenuItem2, char *MenuItem3, char *MenuItem4, int inBackGround);
int inImamInputNumber(char *szLabel, char *szOutput, int MaxSize);
int inImamInputNumberMasked(char *szLabel, char *szOutput, int MaxSize);

int inImamSettleAllHost(TRANSACTION_OBJECT *pobTran);
int inCreateDBFfisrt(void);

int inImamEchoAllHost(TRANSACTION_OBJECT *pobTran);
int inImamLogonAllHost(TRANSACTION_OBJECT *pobTran);
int inImamDummy(TRANSACTION_OBJECT *pobTran);
int inImamComputeMac(unsigned char *szData, int inDataSize);
int inImamEchoOneHost(TRANSACTION_OBJECT *pobTran);
int inImamLogonOneHost(TRANSACTION_OBJECT *pobTran);
int inImamLogonOneHostOnDemand(TRANSACTION_OBJECT *pobTran);
int inImamResetLogonStatus(TRANSACTION_OBJECT *pobTran);
int inImamResetLogonStatusOneHost(TRANSACTION_OBJECT *pobTran);
int inImamSwipeCardVerify(TRANSACTION_OBJECT *pobTran);
int inImamFunction(TRANSACTION_OBJECT *pobTran);
int inImamTestPrint(TRANSACTION_OBJECT *pobTran);
int inImamGetInvNum(TRANSACTION_OBJECT* pobTran);
int inImamGetAuthCode(TRANSACTION_OBJECT* pobTran);
int inImamSetAndCheckPrecompVoid(TRANSACTION_OBJECT* pobTran);
int inImamPredial(TRANSACTION_OBJECT* pobTran);
int inImamEMVAPIGetBaseAmount(TRANSACTION_OBJECT *pobTran);
unsigned short usImamAmtEntryFunc(unsigned long *lnAmountValue);
int inImamEmvTag9f02Adjust(TRANSACTION_OBJECT *pobTran);
int inImamEmvTcUpload(TRANSACTION_OBJECT *pobTran);
int inImamSendOrSaveTC(TRANSACTION_OBJECT *pobTran);
int inImamGetPrivateLabel(TRANSACTION_OBJECT *pobTran);
int inImamGetCVV2(TRANSACTION_OBJECT *pobTran);
int inEditPCLOperation (TRANSACTION_OBJECT *pobTran);
int inEditCTLOperation (TRANSACTION_OBJECT *pobTran);
int inImamKeepCommUp (TRANSACTION_OBJECT *pobTran);
int inImamKeepCommUpEnd (TRANSACTION_OBJECT *pobTran);
int inImamKeepCommUpEndIdle (TRANSACTION_OBJECT *pobTran);

int inImamInitComDevice (TRANSACTION_OBJECT *pobTran);
int inImamSaleContactless (TRANSACTION_OBJECT *pobTran);
int inImamSaleCTLThanksWelcome(TRANSACTION_OBJECT *pobTran);
int inImamSaleMifare (TRANSACTION_OBJECT *pobTran);
int inImamSaleSCard (TRANSACTION_OBJECT *pobTran);

int inImamSetContaclessPRM (TRANSACTION_OBJECT *pobTran);
int inImamSetContaclessMSG (TRANSACTION_OBJECT *pobTran);
int inImamSetContaclessCAPK (TRANSACTION_OBJECT *pobTran);
int inImamEMVSendReversal(TRANSACTION_OBJECT *pobTran);
int inImamMifareFunction(TRANSACTION_OBJECT *pobTran);
int inImamSendInquiry(TRANSACTION_OBJECT *pobTran);
int inImamSendPiggyBack(TRANSACTION_OBJECT *pobTran);
int inImamGetTDesPin(TRANSACTION_OBJECT *pobTran);

int inImamSetTrxOffline(TRANSACTION_OBJECT *pobTran);
int inImamDownloadHostLogo(TRANSACTION_OBJECT *pobTran);
int inImamDownloadBlankLogo(void);
int inImamDownloadLogo(int inLogoID);
int inImamSetMKey1D(TRANSACTION_OBJECT *pobTran);
int inImamSetMKey3D(TRANSACTION_OBJECT *pobTran);
int inImamSetWKey3D(TRANSACTION_OBJECT *pobTran);
int inImamSetMKey3D2(TRANSACTION_OBJECT *pobTran); 

/* dota_license - equipment */
int fImamCheckLisense(void);
int fImamSetLisense(char* szLicenceKey);

/* dota_license - functions to check & set license */
int inImamCheckLicense(TRANSACTION_OBJECT *pobTran);
int inImamSetLicense(TRANSACTION_OBJECT *pobTran);
int inImamValidateMac(unsigned char *szData, int inDataSize);
extern void vdCustDisplayPrompt(long lnMsgId,VS_BOOL fScroll);
extern void vdCustDisplayMessageFromFile(long lnMessageIndex,int inMsgType) ;
int inKrtkSetPabx(TRANSACTION_OBJECT *pobTran);
int inCalculatePin(unsigned char *szPAN, char * PINInput,unsigned char *ePIN);

int inNewPin(TRANSACTION_OBJECT *pobTran);
int inChangePin(TRANSACTION_OBJECT *pobTran);
int inImamMainPassword(TRANSACTION_OBJECT *pobTran);
int inImamPinPassword(TRANSACTION_OBJECT *pobTran);
int inImamNewTPK(TRANSACTION_OBJECT *pobTran);
int inImamSetDisplayType (void);
int inImamResetTPK(TRANSACTION_OBJECT *pobTran);
int inPrintTest(TRANSACTION_OBJECT *pobTran, unsigned char *buffer, int len);
int inmanualtrace(int type,unsigned char *buffer, int len);
#ifdef IMAM_BNI
void ascii2bcd(unsigned char *ascii, unsigned char *bcd);
void bcd2ascii(unsigned char *bcd, unsigned char *ascii, int bcd_len);

#endif


